<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl xe msxsl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xe="http://www.CrossFactory.net/XmlEditor" xmlns:msxsl="urn:schemas-microsoft-com:xslt">

<xsl:output method="xml" version="1.0" omit-xml-declaration="yes" indent="no"/>

<xsl:param name="xe:contentLanguage">en</xsl:param>
<xsl:param name="xe:userLanguage">en</xsl:param>
<xsl:param name="language">en</xsl:param>
<xsl:param name="xe:xmlEditorPath"/>
<xsl:param name="xe:xmlEditorAllowCopy">false</xsl:param>
<xsl:param name="xe:xmlEditorXmlId"/>
<xsl:param name="xe:documentProviderName">SiteNoteManager</xsl:param>
<xsl:param name="xe:editionMode">false</xsl:param>
<xsl:param name="xe:labels"/>

<xsl:param name="applicationPath"/>

<xsl:template name="XmlEditorCancelClick">
	<xsl:param name="tooltip"/>
	<xsl:param name="action"/>
	<xsl:choose>
		<xsl:when test="$xe:editionMode = 'true'">
			<xsl:attribute name="onclick">CancelClick(<xsl:if test="$action">"<xsl:value-of select="$action"/>"</xsl:if>);</xsl:attribute>
			<xsl:attribute name="title"><xsl:value-of select="$xe:labels/label[name = 'ctrlClickTooltip']/*[name(.) = $xe:userLanguage]/text()"/><xsl:value-of select="$tooltip"/></xsl:attribute>
			<xsl:if test="$tooltip">
				<xsl:attribute name="xe:tooltip"><xsl:value-of select="$tooltip"/></xsl:attribute>
			</xsl:if>
		</xsl:when>
		<xsl:when test="$xe:editionMode = 'false'">
			<xsl:attribute name="title"><xsl:value-of select="$tooltip"/></xsl:attribute>
			<xsl:if test="$action">
				<xsl:attribute name="onclick"><xsl:value-of select="$action"/></xsl:attribute>
			</xsl:if>
		</xsl:when>	
	</xsl:choose>
</xsl:template>

<xsl:template name="XmlEditorInfo">
	<xsl:if test="$xe:editionMode = 'true'">
		<xsl:attribute name="xe_id"><xsl:value-of select="@xe:id"/></xsl:attribute>
		<xsl:attribute name="xe_label"><xsl:value-of select="@xe:label"/></xsl:attribute>
	</xsl:if>
	<xsl:if test="$xe:xmlEditorAllowCopy = 'true'">
		<xsl:attribute name="xecopy_id"><xsl:value-of select="@nodeId"/></xsl:attribute>
		<xsl:attribute name="onmouseover">HighlightForCopy();</xsl:attribute>
		<xsl:attribute name="onmouseout">UnHighlightForCopy();</xsl:attribute>
		<xsl:attribute name="onclick">CopyXml('<xsl:value-of select="$xe:xmlEditorXmlId"/>');</xsl:attribute>
	</xsl:if>
</xsl:template>

<xsl:template name="XmlEditorStartTextBlock">
	<xsl:param name="allowEnter">no</xsl:param>
	<xsl:if test="$xe:editionMode = 'true'">
		<xsl:text disable-output-escaping="yes">&lt;</xsl:text>span id="xe_<xsl:value-of select="@xe:id"/>" xe_edit_id="<xsl:value-of select="@xe:id"/>" xe_tag="<xsl:value-of select="name(.)"/>" xe_allowEnter="<xsl:value-of select="$allowEnter"/>" xe_allowHtml="<xsl:value-of select="@xe:allowHtml"/>"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
	</xsl:if>
</xsl:template>

<xsl:template name="XmlEditorEndTextBlock">
	<xsl:if test="$xe:editionMode = 'true'">
		<xsl:text disable-output-escaping="yes">&lt;/span&gt;</xsl:text>
	</xsl:if>
</xsl:template>

	<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
	
	<xsl:template match="newscontent">
		<table border="0" width="95%" cellpadding="3" cellspacing="0">
		<xsl:call-template name="XmlEditorInfo" />
			<tr>
				<td>
					<img src="{$applicationPath}Images/transp.gif" width="100" height="3" />
				</td>
			</tr>
			<tr>
				<td width="100%">
					<xsl:apply-templates select="news"/>
				</td>
			</tr>
		</table>
	</xsl:template>
	
	<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->

	<xsl:template match="news">
		<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<xsl:call-template name="XmlEditorInfo" />
			<tr>
				<td background="{$applicationPath}Images/CommonContent/DashedLine.gif" width="100%">
					<img src="{$applicationPath}Images/transp.gif" width="1" height="1"/>
				</td>
			</tr>
			<tr>
				<td height="100%" valign="top" width="100%">			
					<table border="0" cellpadding="0" cellspacing="0" width="100%">
						<xsl:apply-templates select="newstitle"/>
						<tr>
							<td width="61" valign="top">
								<xsl:apply-templates select="picture"/>
							</td>
							<td width="100%" class="HPtext" valign="top">
								<xsl:apply-templates select="newstext"/>
							</td>
						</tr>
						<tr>
							<td colspan="2" align="right" style="PADDING-BOTTOM:5px" width="100%">
								<xsl:apply-templates select="linkmore"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>
			
	<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->

	<xsl:template match="news[position()='1']">
		<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<xsl:call-template name="XmlEditorInfo" />
			<tr>
				<td height="100%" valign="top" width="100%">			
					<table border="0" cellpadding="0" cellspacing="0" ID="Table11" width="100%">
						<xsl:apply-templates select="newstitle"/>
						<tr>
							<td width="61" valign="top">
								<xsl:apply-templates select="picture"/>
							</td>
							<td width="100%" class="HPtext" valign="top">
								<xsl:apply-templates select="newstext"/>
							</td>
						</tr>
						<tr>
							<td colspan="2" align="right" style="PADDING-BOTTOM:5px" width="100%">
								<xsl:apply-templates select="linkmore"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>
	
	
	<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
	
	<xsl:template match="newstitle">
		<tr>
			<td colspan="2" class="newshptitle">
			<xsl:call-template name="XmlEditorInfo" />	
				<xsl:call-template name="XmlEditorStartTextBlock" />
					<xsl:if test="string-length(translate(text(), ' ', '')) = 0 and string-length(translate(stylerule/text(), ' ', '')) = 0 and string-length(translate(hyperlink/text(), ' ', '')) = 0">
						<xsl:value-of select="$xe:labels/label[name = 'newstitle']/*[name(.) = $xe:userLanguage]/text()"/>
					</xsl:if>
					<xsl:apply-templates />
				<xsl:call-template name="XmlEditorEndTextBlock" />
			</td>
		</tr>
	</xsl:template>
	
	<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
	
	<xsl:template match="newstext">
		<span>
		<xsl:call-template name="XmlEditorInfo" />
			<xsl:call-template name="XmlEditorStartTextBlock" />
			<xsl:if test="string-length(translate(text(), ' ', '')) = 0 and string-length(translate(stylerule/text(), ' ', '')) = 0 and string-length(translate(hyperlink/text(), ' ', '')) = 0">
				<xsl:value-of select="$xe:labels/label[name = 'paragraph']/*[name(.) = $xe:userLanguage]/text()"/>
			</xsl:if>
			<xsl:apply-templates />
			<xsl:call-template name="XmlEditorEndTextBlock" />
		</span>
	</xsl:template>
	
	<!--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
	
	<xsl:template match="picture">
		<div>
			<xsl:call-template name="XmlEditorInfo" />	
			<img border="0" width="61" height="46">
				<xsl:attribute name="alt">
					<xsl:apply-templates select="tooltip/text()" />
				</xsl:attribute>
				<xsl:attribute name="src">
					<xsl:value-of select="$applicationPath" />_SiteNote/WWW/GetFile.aspx?uri=<xsl:value-of select="$xe:documentProviderName" />:<xsl:value-of select="uri"/>
				</xsl:attribute>			
			</img>
		</div>		
	</xsl:template>

</xsl:stylesheet>